<template>
  <a-row type="flex" :gutter="16">
    <a-col :md="4" :sm="24">
      <org-tree v-model="nodeObj" @selectedNode="selectedNode"/>
    </a-col>
    <a-col :md="24-4" :sm="24">
      <a-card :bordered="false">
        <!-- 查询区域 -->
        <div class="table-page-search-wrapper">
          <a-form layout="inline">
            <a-row :gutter="24">
              <a-col :xl="6" :lg="7" :md="8" :sm="24">
                <a-form-item label="时间">
                  <g-year-picker
                    placeholder="请选择时间"
                    :is-init="false"
                    v-model="queryParam.date"
                  ></g-year-picker>
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
        </div>
        <!-- 查询区域-END -->
        <!-- 操作按钮区域 -->
        <!-- table区域-begin   -->
        <div>
          <summary-org-list v-if="this.nodeObj.id == 'A05'" :date="queryParam.date" :score-type="scoreType"></summary-org-list>
          <summary-list v-else :date="queryParam.date" :org-code="nodeObj.id" :score-type="scoreType"></summary-list>
        </div>
      </a-card>
    </a-col>
  </a-row>
</template>

<script>

import orgTree from '@views/gfxy/common/orgTree'
import GYearPicker from '@views/gfxy/common/GYearPicker'
import Vue from 'vue'
import { CURRENT_DATE } from '@/store/mutation-types'
import SummaryOrgList from '@views/gfxy/statistics/summary/common/SummaryOrgList'
import SummaryList from '@views/gfxy/statistics/summary/common/SummaryList'

export default {
  name: 'TeachingBuildSummaryStatistics.vue',
  components: {
    SummaryOrgList,
    orgTree,GYearPicker,SummaryList
  },
  data(){
    return {
      queryParam:{
        date: ''
      },
      currentOrgCode:'',
      nodeObj:{},
      scoreType: 2
    }
  },
  methods:{
    selectedNode(nodeObj){
      this.nodeObj = nodeObj
      console.log("nodeObj:",nodeObj)
    }
  },
  created() {
    this.queryParam.date = Vue.ls.get(CURRENT_DATE);
  },
}
</script>

<style scoped>

</style>